﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list_schools.aspx.cs" Inherits="list_schools"%>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
   <title>List school</title>
   <link rel="stylesheet" href="../styles/jquery.autocomplete.css" type="text/css" />
   <link href="styles/style.css" rel="stylesheet" type="text/css" />   
      
   <link type="text/css" href="../css/smoothness/jquery-ui-1.8.11.custom.css" rel="stylesheet" /> 
   <script src="js/jquery-1.5.min.js" type="text/javascript"></script>
   <script src="js/jquery-ui-1.8.9.custom.min.js" type="text/javascript"></script>
  
   
</head>
<body>
    <form id="form1" runat="server">

    <div class="wrapper">
       <div id="header">
		<h1 class="logo">
        <a href="index.aspx">
        	<img src="images/logo.png" width="280" height="46" border="0" /></a>
        
        </h1>
         <div class="login_zone" >
        Username:<asp:Literal ID="lUsername" Text="" runat="server" />
        <br />
         <asp:LinkButton ID="lnkLogout" runat="server" Text="Logout" 
                 onclick="lnkLogout_Click" /> | <a href="login/change_pass.aspx">Change password</a>
        </div>
        </div>
     <div class="clear"></div>
        <div id="nav">
         <div style="margin-bottom:20px;width:280px;float:left;">
              <ul class="breadcrumb">
            <li>
                <a href="index.aspx" title="Home">
             
                        <img src="images/home.png" width="24" height="23" border="0" align="left" style="margin-top:2px;" class="home" />
          
                </a>
              
            </li>
            <li>
            <a href="index.aspx"   title="homepage">
                Homepage
                </a>
            </li>
            <li>
                
                    List schools
                
           </li>
      
     </ul>
     </div>
        </div>
         <div class="main_content2">
           <div style="margin-top:-8px;">
             <img src="images/list_schools.png" width="900" height="77" />
           </div>
           <br /><br />
            <table width="100%">
            
        <tr>
        
            <td align="right">
                
            
                &nbsp;City:</td>
        
            <td align="left" >
                
            
                  <asp:DropDownList ID="cbCity" runat="server">
                  </asp:DropDownList>
            &nbsp; School ID:
                
            
                  <asp:TextBox ID="txtSchoolID" runat="server" CssClass="box2" Width="230px" 
                      Height="20px"></asp:TextBox>
              
            </td>
        </tr>
    
        <tr>
        
            <td align="left">
                
            
                School name:</td>
        
            <td align="left">
                
            
                  <asp:TextBox ID="txtSchoolName" runat="server" CssClass="box2" Width="408px" 
                      Height="20px"></asp:TextBox>
              
                  &nbsp;
                                
                  <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                  </ajaxToolkit:ToolkitScriptManager>
                                
                  </td>
        </tr>
    
        <tr>
        
            <td align="right">
                
            
                Address:</td>
        
            <td align="left">
                
            
                <asp:TextBox ID="txtAddress" runat="server" CssClass="box2" Width="408px"  
                    Height="20px"></asp:TextBox>&nbsp; Điện thoại:
              
                  <asp:TextBox ID="txtTele" runat="server" CssClass="box2" Width="100px" 
                    Height="20px"></asp:TextBox>
              
                  &nbsp;&nbsp;&nbsp;
                
            
                <asp:Button ID="btnAdd" runat="server" Text="Add" class="button white" onclick="btnAdd_Click" 
                   
                     />
              
                  &nbsp;<asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                    class="button white" onclick="btnCancel_Click" 
                   
                     />
              
                  </td>
        
        </tr>
    
        <tr>
        
            <td align="left" colspan="2" >
                
            
                <asp:GridView ID="gdSchools" runat="server" AllowPaging="True" AutoGenerateColumns="False"                    
                  
                   CssClass="border_grid" HorizontalAlign="Center" 
                     Width="90%" 
                         DataKeyNames="school_id"
                        
                
                    onrowediting="gdSchools_RowEditing" 
                    onpageindexchanging="gdSchools_PageIndexChanging" 
                    onrowdatabound="gdSchools_RowDataBound" onrowcommand="gdSchools_RowCommand" onrowdeleting="gdSchools_RowDeleting" 
               
              
                    >
                   <PagerStyle CssClass="grid_footer_pager" />
                   <Columns>
           
                       <asp:TemplateField HeaderText="No">
                           <HeaderStyle CssClass="header_grid" />
                           <ItemTemplate>
                                   <%#Container.DataItemIndex + 1%>
                           </ItemTemplate> 
                       </asp:TemplateField>
   
                       
                       <asp:TemplateField HeaderText="City">
                           <HeaderStyle CssClass="header_grid" />
                            <ItemTemplate>
                            <%#Eval("city_id") %>
                        </ItemTemplate>
                       </asp:TemplateField>
                       
                       
                       <asp:TemplateField HeaderText="school id">
                        <ItemTemplate>
                            <%#Eval("school_id") %>
                        </ItemTemplate>
                           <HeaderStyle CssClass="header_grid" />
                       </asp:TemplateField>
                       
                       
                       <asp:TemplateField HeaderText="school name">
                       <HeaderStyle CssClass="header_grid" />
                          <ItemTemplate>
                             <%#Eval("schoolname") %>
                          </ItemTemplate>
                                        
                           <ItemStyle HorizontalAlign="Left" />
                                        
                       </asp:TemplateField>
                          
                       <asp:TemplateField HeaderText="Address">
                       <HeaderStyle CssClass="header_grid" />
                          <ItemTemplate><%#Eval("address") %></ItemTemplate>
                           <ItemStyle HorizontalAlign="Left" />
                       </asp:TemplateField>
                       
                       <asp:TemplateField HeaderText="Telephone">
                       <HeaderStyle CssClass="header_grid" />
                               <ItemTemplate><%#Eval("tele") %></ItemTemplate>
                           <ItemStyle HorizontalAlign="Left" />
                       </asp:TemplateField>
                       
                       
                       <asp:TemplateField HeaderText="Action">
                           <HeaderStyle CssClass="header_grid" />
                          <ItemTemplate>
                              <asp:LinkButton ID="btnEditSchool" runat="server" Text="Edit" CommandName="Edit" OnClick="School_Edit" />
                              
                               <asp:LinkButton ID="lnkButtonDelete" CommandArgument='<%#Eval("school_id")%>' CommandName="Delete" runat="server">
                                  Delete
                               </asp:LinkButton>
                              
                          </ItemTemplate>
                           <ItemStyle HorizontalAlign="Center" />
                       </asp:TemplateField>
                       
                       
                   </Columns>
                   <FooterStyle HorizontalAlign="Right" BackColor="DarkGray" BorderColor="DarkGray" 
                        BorderStyle="Solid" BorderWidth="1px" />
                
                   <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
               </asp:GridView>
            </td>
        </tr>    
    </table>
    
            <asp:Panel ID="panelEdit" runat="server">
    
   
     <br />
     <table style="width: 422px; background-color: #ffffdd;filter: alpha(opacity=0.9);opacity: 0.9;" >
        <tr>
            <td align="right">
            
                School ID:</td>
        
            <td align="left">
                <asp:TextBox ID="txtSchoolID2" runat="server" CssClass="box2"></asp:TextBox>
            </td>
        
        </tr>
        <tr>
            <td align="right">
            
                Shool Name:</td>
            <td align="left">
                <asp:TextBox ID="txtSchoolName2" runat="server" CssClass="box2" Width="273px"></asp:TextBox>
            </td>
        </tr>
         <tr>
             <td>
                 &nbsp;</td>
             <td  align="left">
                 <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="button white" 
                     onclick="btnSave_Click" />
                 &nbsp;
                 <asp:Button ID="btnCancelEdit" runat="server" Text="Cancel" CssClass="button white" OnClientClick="return hidePopup();"/>
             </td>
         </tr>
     </table>
    </asp:Panel>
            <asp:LinkButton ID="lnkFake" runat="server"></asp:LinkButton>
            <ajaxToolkit:ModalPopupExtender ID="popupEdit" runat="server"
                     PopupControlID="panelEdit" TargetControlID="lnkFake" />
            <uc:OkMessageBox ID="omb" runat="server" />
         </div>
       </div>
  </form>
</body>
</html>

